#ifndef BACKUP_CLIENT_H
#define BACKUP_CLIENT_H

#include <QObject>
#include <QWidget>
#include "dataManager.hpp"
#include "httplib.h"
#include <windows.h>
#include <QDebug>
#include <chrono>
#include <optional>
#include <ctime>
#include <experimental/filesystem>
#include <QFileSystemWatcher>
#include <QDir>
#include "DirectoryWatcher.h"

#define SERVER_ADDR "120.46.25.211"
#define SERVER_PORT 8585

namespace cloudBackup
{
class Backup_Client : public QObject
{
    Q_OBJECT
public:
    Backup_Client(QObject *parent, const std::string& backupDir, int usrID);
    std::string GetFileSelfEtag(const std::string& filePath);
    bool Upload(const std::string& filename);

    void fileADD(const QString &filePath);
    void fileMODIFY(const QString &filePath);
    void fileREMOVE(const QString &filePath);
private:
    std::string _backupDir;
    DataManager* _dataManager;
    DirectoryWatcher* _dirWatcher;
    int _usrID;
};

}
#endif // BACKUP_CLIENT_H
